<?php

namespace Kateba\GOOBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class GOOController extends Controller {

    /**
     * the site home page
     * @author Mahmoud
     */
    public function homeAction() {
        $page = $this->getDoctrine()->getEntityManager()->getRepository('KatebaSiteBundle:Page')->find(12);
        if (!$page) {
            throw $this->createNotFoundException('Can not find the requested page');
        }
        return $this->render('KatebaGOOBundle:GOO:index.html.twig', array('page' => $page));
    }

    /**
     * the goo main description page
     * @author Mahmoud
     */
    public function showAction() {
        $page = $this->getDoctrine()->getEntityManager()->getRepository('KatebaSiteBundle:Page')->find(1);
        if (!$page) {
            throw $this->createNotFoundException('Can not find the requested page');
        }
        return $this->render('KatebaGOOBundle:GOO:show.html.twig', array('page' => $page));
    }

    /**
     * the alex rep page
     * @author Mahmoud
     */
    public function alexRepAction() {
        $page = $this->getDoctrine()->getEntityManager()->getRepository('KatebaSiteBundle:Page')->find(6);
        if (!$page) {
            throw $this->createNotFoundException('Can not find the requested page');
        }
        return $this->render('KatebaGOOBundle:GOO:alexRep.html.twig', array('page' => $page));
    }

}
